<template>
  <base-paenl>
    <span slot="header">工作情况</span>
    <div slot="main" class="slot-main">
      <div class="panel-first-row">
        <div class="panel-first-content" @click="handleClick('ht')">
          <div class="panel-first-content-top">
            <div
              :class="
                active == 'ht'
                  ? 'panel-first-content-bg panel-first-content-bg-ht-active'
                  : 'panel-first-content-bg panel-first-content-bg-ht'
              "
            ></div>
            <div class="panel-first-content-value">{{ data.htbaCount }}</div>
          </div>
          <div class="panel-first-content-name">合同备案总数</div>
        </div>
        <div class="panel-first-content" @click="handleClick('fy')">
          <div class="panel-first-content-top">
            <div
              :class="
                active == 'fy'
                  ? 'panel-first-content-bg panel-first-content-bg-fy-active'
                  : 'panel-first-content-bg panel-first-content-bg-fy'
              "
            ></div>
            <div class="panel-first-content-value">{{ data.fyfbshCount }}</div>
          </div>
          <div class="panel-first-content-name">房源发布审核数</div>
        </div>
      </div>
      <div v-for="(item, index) of dataList" :key="index">
        <div class="panel-second-row5">
          <div class="panel-row-title">
            {{ item.name }}
          </div>
          <div class="panel-row-main">
            <div class="panel-row-content">
              <div class="panel-row-content-value">
                <font class="panel-row-content-value-count">{{
                  item.bnlj
                }}</font
                >个次
              </div>
              <div class="panel-row-content-name">
                本年累计
              </div>
            </div>
            <div class="panel-row-content">
              <div class="panel-row-content-value">
                <font class="panel-row-content-value-count">{{
                  item.jdlj
                }}</font
                >个次
              </div>
              <div class="panel-row-content-name">
                季度累计
              </div>
            </div>
            <div class="panel-row-content">
              <div class="panel-row-content-value">
                <font class="panel-row-content-value-count">{{
                  item.bylj
                }}</font
                >个次
              </div>
              <div class="panel-row-content-name">
                本月累计
              </div>
            </div>
            <div class="panel-row-content">
              <div class="panel-row-content-value">
                <font class="panel-row-content-value-count">{{ item.jr }}</font
                >个次
              </div>
              <div class="panel-row-content-name">
                今日
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </base-paenl>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
import BasePaenl from "./CBase.vue";
import exportVue from "@/assets/modules/exportVue";

@Component({
  name: "TaskHandling",
  components: { BasePaenl }
})
export default class extends Vue {
  data: any = {};
  dataList: any = [];
  active = "";
  mounted() {
    const _this = this;
    exportVue.$on("initGrid", (item: any) => {
      _this.data = item;
      _this.dataList = _this.data.taskInfo;
    });
  }
  handleClick(type: string) {
    this.active = type;
    if (this.active == "fy") {
      this.showDialog("房源发布审核数");
    } else {
      this.showDialog2();
    }
  }
  showDialog(name: any) {
    const floorSiteData: any = {
      name: name
    };
    this.$store.commit("panel/setDialogShow", false);
    this.$nextTick(() => {
      this.$store.commit("panel/setDialogShow", true);
      this.$store.commit("panel/setDialog", "floorSite");
      this.$store.commit("panelData/setFloorSiteData", floorSiteData);
    });
  }
  showDialog2() {
    console.log(this.data.tenancyContract);
    const tenancyContract = JSON.parse(JSON.stringify(this.data.tenancyContract));
    this.$store.commit("panel/setDialogShow", false);
    this.$nextTick(() => {
      this.$store.commit("panel/setDialogShow", true);
      this.$store.commit("panel/setDialog", "tenancyContract");
      this.$store.commit(
        "panelData/setTenancyContractData",
        tenancyContract
      );
    });
  }
}
</script>

<style lang="scss" scoped>
.slot-main {
  height: 597px;
  .panel-first-row {
    height: 132px;
    .panel-first-content {
      cursor: pointer;
      .panel-first-content-top {
        width: 202px;
        height: 84px;
        .panel-first-content-bg {
          width: 98px;
          height: 84px;
        }
        .panel-first-content-bg-ht {
          background-image: url(../../assets/images/panels/hetongbeianzongshudianjiqian.png);
          background-size: 100% 100%;
        }
        .panel-first-content-bg-ht-active {
          background-image: url(../../assets/images/panels/hetongbeianzongshudianjihou.png);
          background-size: 100% 100%;
        }
        .panel-first-content-bg-fy {
          background-image: url(../../assets/images/panels/hetongbeianzongshudianjiqian.png);
          background-size: 100% 100%;
        }
        .panel-first-content-bg-fy-active {
          background-image: url(../../assets/images/panels/hetongbeianzongshudianjihou.png);
          background-size: 100% 100%;
        }
        .panel-first-content-value {
          top: 10px;
        }
      }
      .panel-first-content-name {
        margin-top: 5px;
      }
    }
  }
  .panel-second-row5 {
    .panel-row-title {
      width: 388px;
      height: 17px;
      margin-bottom: 10px;
    }
    .panel-row-main {
      margin-bottom: 15px;
    }
    .panel-row-content {
      width: 93px;
      height: 53px;
    }
  }
}
</style>
<style lang="scss">
.panel-second-row5 {
  .panel-row-title {
    background-image: url(../../assets/images/panels/cibiaotibeijingkuang-dianjiqian.png);
    background-size: 100% 100%;
    padding-left: 30px;
    font-family: AlibabaPuHuiTi_2_65_Medium;
    font-size: 16px;
    line-height: 17px;
    color: #fefefe;
  }
  .panel-row-main {
    display: flex;
  }
  .panel-row-content {
    background-image: url(../../assets/images/panels/biaogekuang-gao.png);
    background-size: 100% 100%;
    font-family: AlibabaPuHuiTi_2_55_Regular;
    font-size: 12px;
    line-height: 17px;
    color: #ffffff;
    padding: 5px 0;
    margin-right: 10px;
  }
  .panel-row-content-value {
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    .panel-row-content-value-count {
      font-size: 16px;
      line-height: 17px;
      color: #fad06d;
    }
  }
  .panel-row-content-name {
    height: 21px;
    display: flex;
    justify-content: center;
    align-items: center;
  }
}
</style>
